
#include "system.h"


#include <thread>
#include <chrono>



/* returns the number of milli seconds since ... */
unsigned long SYSTEM::millis()
{
    auto time_point = std::chrono::high_resolution_clock::now();
    auto sysDuration = time_point.time_since_epoch();

    return std::chrono::duration_cast<std::chrono::milliseconds>(sysDuration).count();
}


/* sleeps the current thread for _uMillis milli-seconds */
void SYSTEM::sleep(unsigned long _uMillis)
{
    std::this_thread::sleep_for(std::chrono::milliseconds(_uMillis));
}
